<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>


<form:form modelAttribute="creditCard" action="${flowExecutionUrl}&_eventId=proceed">

	<div class="section">
	<span class="errors"> <form:errors path="*" /> </span> 
	
	<br />

	<h2>Pay with Credit Card</h2>

	<fieldset>
 

	<div class="field">
	<div class="label">Total Price: </div>
	<div class="input">U$ ${ flightQuery.numberPassengers * (flightDeparting.price + flightReturning.price) }</div>	
	</div>

	<div class="field">
	<div class="label">Card Holder Name: </div>
	<div class="input"><form:input path="cardHolderName" maxlength="40" />	</div>
	<script type="text/javascript">
	Spring.addDecoration(new Spring.ElementDecoration( {
		elementId : "cardHolderName",
		widgetType : "dijit.form.ValidationTextBox",
		widgetAttrs : { required : true  }}));
	</script>
	</div>
	
	<div class="field">
	<div class="label">Card Number: </div>
	<div class="input"><form:input path="cardNumber" maxlength="16" />	</div>
	<script type="text/javascript">
	Spring.addDecoration(new Spring.ElementDecoration( {
		elementId : "cardNumber",
		widgetType : "dijit.form.ValidationTextBox",
		widgetAttrs : { required : true, regExp: "[0-9]{14,16}"  }}));
	</script>
	</div>
	
	<div class="field">
	<div class="label">Month:   </div>
	<div class="input"><form:select path="expMonth"  items="${creditCard.months}" /> &nbsp;&nbsp; Year:  <form:select path="expYear" items="${creditCard.years}" /> </div>
	</div>
	
	
	<div class="field">
	<div class="label">Address: </div>
	<div class="input"><form:input path="address" maxlength="15" />	</div>
	<script type="text/javascript">
	Spring.addDecoration(new Spring.ElementDecoration( {
		elementId : "address",
		widgetType : "dijit.form.ValidationTextBox",
		widgetAttrs : { required : true  }}));
	</script>
	</div>
	


	<div class="buttonGroup">
	<input type="submit" id="proceed" name="_eventId_proceed" value="Authorize Payment" onclick="showDialog('Authorizing Credit Card ....', this.form, null);" />&#160; 
	<script type="text/javascript">
	Spring.addDecoration(new Spring.ValidateAllDecoration( {
		elementId : 'proceed',
		event : 'onclick'
	}));
	</script>
	<input type="submit" id="cancel" name="_eventId_cancel" value="Select Another Payment" />&#160;
	
	</div>


	</fieldset>


	</div>


</form:form>
